﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true" CodeBehind="EstiloImagenes.aspx.cs" Inherits="Emporium_Web.EstiloImagenes" Theme="Constellation" %>

<%@ MasterType VirtualPath="~/Menu.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register TagPrefix="emporium" TagName="EstiloImagenUpload" Src="~/Controls/EstiloImagenUpload.ascx" %>
<%@ Register TagPrefix="emporium" TagName="EstiloImagenShow" Src="~/Controls/EstiloImagenShow.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Listado de Imágenes por estilo</title>
    <script type="text/javascript">
        var hdnSeleccionId = '<%= this.hdnSeleccion.ClientID %>';
    </script>
    <script type="text/javascript" src="js/funciones.grid.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- Content -->
    <article class="container_12">
	  
		<section class="grid_12">
			<div class="block-border">
			<form runat="server" class="block-content form" id="table_form">
            
				<h1>Im&aacute;genes por Estilo</h1>
                 <ajaxToolkit:ToolkitScriptManager ID="toolk" runat="server"></ajaxToolkit:ToolkitScriptManager>               

				<asp:HiddenField ID="hdnSeleccion" runat="server" />               

				<ul class="message error no-margin" runat="server" id="errorMessage">
					<li><asp:Label runat="server" ID="lblErrorMessage"></asp:Label></li>
				</ul>
                <ul class="message warning no-margin" runat="server"  id="warningMessage">
					<li><asp:Label runat="server" ID="lblWarningMessage"></asp:Label></li>
				</ul>

                <div class="no-margin">

				    <asp:GridView ID="gvImagenes" runat="server" SkinID="gridviewSkin" PageSize="5" 
                            Width="100%" AllowSorting="True" onrowcommand="gvImagenes_RowCommand" AutoGenerateColumns="False" 
                            onrowdatabound="gvImagenes_RowDataBound" ShowFooter="true" >
                        <Columns>                   
                             <asp:TemplateField HeaderText="Secuencial">
                                <HeaderStyle HorizontalAlign="Center" ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>
                                   Secuencial
                                </HeaderTemplate>
                                <ItemTemplate>
                                     <%# Eval("Secuencial", "{0:000}")%>
								</ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"/>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Descripción">
                                <HeaderStyle ForeColor="White" Font-Bold="true"></HeaderStyle>
                                 <FooterTemplate>
                                    <asp:TextBox ID="txtDescripcion" runat="server" Width="95%"></asp:TextBox> 
                                    <asp:RequiredFieldValidator ID="reqDescripcionImagen" runat="server" ControlToValidate="txtDescripcion" ErrorMessage="" ValidationGroup ="AgregarImagen"></asp:RequiredFieldValidator>
                                </FooterTemplate>
                                <ItemTemplate> 
                                    <asp:Label ID="lblDescripcion" runat="server" Text='<%# Bind("Descripcion") %>'></asp:Label> 
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" Width="40%" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField>
                                <HeaderStyle ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>                                    
                                    Fecha Registro
                                </HeaderTemplate>
                                 <FooterTemplate>
                                    <asp:Label ID="lblFechaRegistro" runat="server"></asp:Label>                                     
                                </FooterTemplate>
                                <ItemTemplate>
                                    <%# Eval("FechaRegistro", "{0:dd/MM/yyyy}")%>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" Width="10%" />
                            </asp:TemplateField>

                             <asp:TemplateField>
								<HeaderTemplate>
									Visible
								</HeaderTemplate>
                                <FooterTemplate>
                                   <asp:CheckBox id="chkVisibleNuevo" runat = "server" value ="true" />                                     
                                </FooterTemplate>
								<ItemTemplate>                                      
                                    <asp:CheckBox id="chkVisible" runat = "server" value ="true" />
								</ItemTemplate>
								<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								<ItemStyle HorizontalAlign="Left" Width="8%" />
							</asp:TemplateField>

                             <asp:TemplateField>
								<HeaderTemplate>
									Defecto
								</HeaderTemplate>
                                 <FooterTemplate>
                                   <asp:CheckBox id="chkDefectoNuevo" runat = "server" value ="true" />                                     
                                </FooterTemplate>
								<ItemTemplate>
                                     <asp:CheckBox id="chkDefecto" runat = "server" value ="true" />                                      
								</ItemTemplate>
								<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								<ItemStyle HorizontalAlign="Left" Width="8%" />
							</asp:TemplateField>

                            <asp:TemplateField>
								<HeaderTemplate>
									Imágenes
								</HeaderTemplate>
                                 <FooterTemplate>
                                    <emporium:EstiloImagenUpload runat="server" ID="estiloImagenUpload" />
                                </FooterTemplate>
								<ItemTemplate>
                                    <asp:ImageButton ID="imgImagen" runat="server"  CommandName="ViewImage" Width="72px" Height="72px" CommandArgument='<%# Eval("Id") %>'></asp:ImageButton>
								</ItemTemplate>
								<ItemStyle HorizontalAlign="Center" Width="15%" />
							</asp:TemplateField>  

                             <asp:TemplateField>
                                <FooterTemplate>
                                    <asp:LinkButton ID="lnkAdicionar" runat="server" CommandName="Insert" Text="Adicionar" ValidationGroup ="AgregarImagen"></asp:LinkButton> 
                                </FooterTemplate>
                                <ItemTemplate> 
                                   <asp:LinkButton ID="lnkEliminar" runat="server" CausesValidation="false" OnClientClick="return DeleteRegsCommand();" CommandName="Remove" CommandArgument='<%# Eval("Id") %>' Text="Eliminar"></asp:LinkButton> 
                                </ItemTemplate>
							</asp:TemplateField>
						</Columns>
						<PagerSettings Visible="false" />
					</asp:GridView> 				
              
				</div>                

                <ul class="message no-margin" runat="server" id="ulMensajeGridFooter">
                    <li>
                        <asp:Label ID="lblMensajeGridFooter" runat="server"></asp:Label>
                    </li>
				</ul>                

				<!-- footer para cerrar el estilo bien-->
				<fieldset class="grey-bg no-margin">
				<br />
						<asp:LinkButton ID="btnGrabar" runat="server" CssClass="button red" Text="Grabar" OnClick="btnGrabar_Click" ValidationGroup="EstiloFormValitationGroup" ></asp:LinkButton>
                        <asp:LinkButton ID="btnAtras" runat="server" CssClass="button red" Text="Atrás" OnClick="btnAtras_Click" CausesValidation="false"></asp:LinkButton>
				</fieldset>

                <emporium:EstiloImagenShow runat="server" ID="estiloImagenShow" />

			</form>
			</div>

            

		</section>
	</article>
</asp:Content>
